#include<sys/mman.h>
#include<stdio.h>
#include<sys/stat.h>
#include<sys/types.h>
#include<fcntl.h>
#include<errno.h>
#include<unistd.h>
#include<string.h>
#include <stdlib.h>
int main(int argc,char **argv)
{
    int fd;
    fd=open(argv[1],O_RDWR|O_CREAT,0655);
    FILE* fp=fdopen(fd,"a+");
    fputs("hello world",fp);
    int fd2=fileno(fp);
    lseek(fd2,0,SEEK_SET);
    char buff[1024]={0};
    read(fd2,buff,sizeof(buff));
    printf("%s",buff);
    fclose(fp);
    close(fd);
    return 0;
}